home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / programs / lora210e.zip / STRUCT.ZIP / LORA.H < prev    next >
C/C++ Source or Header  |  1992-04-07  |  16KB  |  359 lines

  1. /*
  2.                           Lora-CBIS Ver. 2.10
  3.  
  4.          Copyright (c) 1989, 1990, 1991, 1992 by Marco Maccaferri.
  5.                           All rights reserved.
  6.  
  7.  
  8.                    Structure definitions for release
  9.  
  10.  
  11.  
  12.   You may use those structures at your own risk. The author cannot guarantee
  13.   that this structures are maintained in all future versions of the program.
  14.   You can freely (and you are encouraged on that) distribute this file
  15.   without limitations.
  16.  
  17.   You can contact the autor at one of the following address:
  18.  
  19.   Marco Maccaferri
  20.   BBS    : 39-51-6331730 (2:332/402)
  21.   BIX    : marco.m
  22.   Exec-PC: MACCAFERRI MARCO
  23.  
  24. */
  25.  
  26. typedef unsigned int  bit;
  27. typedef unsigned int  word;
  28. typedef unsigned char byte;
  29. typedef long          dword;
  30.  
  31. struct _stamp
  32. {
  33.    unsigned int date;      /* (year - 1980) * 512 + month * 32 + day */
  34.    unsigned int time;      /* hour * 2048 + minute * 32 + second/2 */
  35. };
  36.  
  37. struct _lastread
  38. {
  39.    word area;              /* Message area number */
  40.    int msg_num;            /* Last message read */
  41. };
  42.  
  43. #define MAXLREAD   30
  44. #define MAXDLREAD  10
  45. #define MAXFLAGS   4
  46. #define MAXCOUNTER 10
  47.  
  48. struct _usridx       /* Structure for the USERS.IDX file */
  49. {
  50.    long id;              /* User-ID is the 32 bit CRC of the user's name */
  51. };
  52.  
  53. struct _usr          /* Structure for the USERS.BBS file */
  54. {
  55.    char  name[36];         /* User's name */
  56.    char  handle[36];       /* User's handle */
  57.    char  city[26];         /* User's city */
  58.  
  59.    struct _lastread lastread[MAXLREAD];   /* Last messages read for the last
  60.                                              MAXLREAD message areas (used for
  61.                                              QWK selections) */
  62.    struct _lastread lastread2[MAXDLREAD]; /* Last messages read for the last
  63.                                              MAXDLREAD message areas */
  64.    char  pwd[16];          /* User's password (crypted) (*) */
  65.    dword times;            /* Times the user has called the system */
  66.    word  nulls;            /* Number of nulls (0) sent after a CR/LF */
  67.    word  msg;              /* User's last message area visited */
  68.  
  69.    bit   avatar    :1;     /* 1=Avatar color/graphics enabled */
  70.    bit   color     :1;     /* 1=Color codes will be sent */
  71.    bit   scanmail  :1;     /* 1=Check for mail at logon */
  72.    bit   use_lore  :1;     /* 0=Use the Ansi full screen editor */
  73.    bit   more      :1;     /* 1=Pause at the end of each page */
  74.    bit   ansi      :1;     /* 1=Ansi color/graphics enabled */
  75.    bit   kludge    :1;     /* 1=Display the ^a kludge lines */
  76.    bit   formfeed  :1;     /* 1=Screen clearing codes will be sent */
  77.  
  78.    bit   hotkey    :1;     /* 1=Hot keyed menus */
  79.    bit   tabs      :1;     /* 0=tabs (9) are converted to spaces */
  80.    bit   full_read :1;     /* 1=Full screen message wiewer */
  81.    bit   badpwd    :1;     /* 1=Bad password for the last call */
  82.    bit   usrhidden :1;     /* 1=The user is hidden from the users list */
  83.    bit   nokill    :1;     /* 1=Don't kill this user */
  84.    bit   ibmset    :1;     /* 1=Character > 127 will be sent */
  85.    bit   deleted   :1;     /* 1=User is deleted from the list */
  86.  
  87.    byte  language;         /* User's language number */
  88.    byte  priv;             /* User's privilege level */
  89.    long  flags;            /* Flags settings */
  90.    char  ldate[20];        /* User's last call date */
  91.    int   time;             /* Time the user has spent on-line today */
  92.    dword upld;             /* User's total kbytes uploaded */
  93.    dword dnld;             /* User's total kbytes downloaded */
  94.    word  dnldl;            /* Users' kbytes downloaded today */
  95.    word  n_upld;           /* Number of files uploaded */
  96.    word  n_dnld;           /* Number of files downloaded */
  97.    word  files;            /* User's last file area visited */
  98.    word  credit;           /* Netmail credit */
  99.    word  dbase;            /* <reserved> (**) */
  100.    char  signature[58];    /* User's personal signature */
  101.    char  voicephone[20];   /* User's voice telephone number */
  102.    char  dataphone[20];    /* User's data telephone number */
  103.    char  birthdate[10];    /* User's date of birth */
  104.    char  subscrdate[10];   /* Subscription date <not used> */
  105.    char  firstdate[20];    /* User's first call date and time */
  106.    char  lastpwdchange[10];/* User's last password change date */
  107.    long  ptrquestion;      /* Pointer to the answer questionaire file */
  108.    byte  len;              /* User's screen length */
  109.    byte  width;            /* User's screen width */
  110.    long  id;               /* This is the 32 bit CRC of the user's name */
  111.    int   msgposted;        /* Number of messages posted */
  112.    char  comment[80];      /* Comment for advanced user editors */
  113.    byte  help;             /* <reserved> (**) */
  114.    word  baud_rate;        /* Last call connection speed */
  115.    byte  counter[MAXCOUNTER]; /* General pourpouse counters */
  116.    word  chat_minutes;     /* Minutes used today to chat with Sysop */
  117.  
  118.    bit   xfer_prior:1;     /* 1=No download limits */
  119.    bit   quiet     :1;     /* <reserved> (**) */
  120.    bit   nerd      :1;     /* 1=Yell don't bell for this user */
  121.  
  122.    char  protocol;         /* <reserved> (**) */
  123.    char  archiver;         /* <reserved> (**) */
  124.  
  125.    struct _ovr_class_rec { 
  126.       int  max_time;       /* Minutes per day */
  127.       int  max_call;       /* Minutes per call */
  128.       int  max_dl;         /* Download limit */
  129.       word ratio;          /* Download/Upload ratio */
  130.       word min_baud;       /* Minimum logon baud */
  131.       word min_file_baud;  /* Minimum download bad */
  132.       word start_ratio;    /* Start ratio */
  133.    } ovr_class;
  134.  
  135.    int   sig;              /* <reserved> (**) */
  136.    word  account;          /* Account for time bank */
  137.    word  f_account;        /* Account for file bank */
  138.    int   votes;            /* Holds votes received */
  139.  
  140.    char  extradata[28];    /* Reserved for future use */
  141.                            /* Total=640 bytes */
  142. };
  143.  
  144. #define SIZEOF_MSGAREA    224
  145. #define SIZEOF_FILEAREA   225
  146.  
  147. struct _sys          /* Structure for the internal system records.
  148.                         The files SYSMSG.DAT and SYSFILE.DAT
  149.                         are composed by the respective portions of this
  150.                         structure */
  151. {
  152.    /* Begin of the SYSMSG.DAT file --------------------------------------- */
  153.    char msg_name[70];      /* Message area name */
  154.    int  msg_num;           /* Message area number */
  155.    char msg_path[40];      /* Message area path */
  156.    char origin[56];        /* Echomail origin line */
  157.    bit  echomail  :1;      /* 1=Echomail area */
  158.    bit  netmail   :1;      /* 1=Netmail area */
  159.    bit  public    :1;      /* 1=Public message allowed */
  160.    bit  private   :1;      /* 1=Private message allowed */
  161.    bit  anon_ok   :1;      /* 1=Use the user's handle in the from field */
  162.    bit  no_matrix :1;      /* <reserved> (**) */
  163.    bit  squish    :1;      /* Squish<tm> message area */
  164.    word msg_sig;           /* <reserved> (**) */
  165.    char echotag[32];       /* Echotag name */
  166.    word pip_board;         /* Pip-base board number */
  167.    byte quick_board;       /* QuickBBS board number */
  168.    byte msg_priv;          /* Minimum level to access this area */
  169.    long msg_flags;         /* Flags settings */
  170.    byte write_priv;        /* Minimum level to write messages */
  171.    long write_flags;       /* Flags settings */
  172.    byte use_alias;         /* Use alias # with this area */
  173.    int  max_msgs;          /* Maximum number of messages in this area */
  174.    int  max_age;           /* Max age of messages (days) */
  175.    int  age_rcvd;          /* Max age of received messages (days) */
  176.    /* End of the SYSMSG.DAT file ----------------------------------------- */
  177.  
  178.    /* Begin of the SYSFILE.DAT file -------------------------------------- */
  179.    char file_name[70];     /* File area name */
  180.    int  file_num;          /* File area number */
  181.    char uppath[40];        /* Upload path */
  182.    char filepath[40];      /* Download path */
  183.    char filelist[50];      /* CD-ROM list file name */
  184.    bit  freearea  :1;      /* Free download limit */
  185.    bit  norm_req  :1;      /* <reserved> (**) */
  186.    bit  know_req  :1;      /* <reserved> (**) */
  187.    bit  prot_req  :1;      /* <reserved> (**) */
  188.    bit  nonews    :1;      /* <reserved> (**) */
  189.    bit  no_global_search :1; /* 1=Exclude from global searches */
  190.    bit  no_filedate :1;    /* <reserved> (**) */
  191.    word file_sig;          /* <reserved> (**) */
  192.    byte file_priv;         /* Minimum level to access this area */
  193.    long file_flags;        /* Flags settings */
  194.    byte download_priv;     /* Minimum level to download files */
  195.    long download_flags;    /* Flags settings */
  196.    byte upload_priv;       /* Minimum level to upload files */
  197.    long upload_flags;      /* Flags settings */
  198.    byte list_priv;         /* Minimum level to see the file titles */
  199.    long list_flags;        /* Flags settings */
  200.    /* End of the SYSFILE.DAT file ---------------------------------------- */
  201. };
  202.  
  203. struct _sys_idx     /* Structure for the SYSMSG.IDX, SYSFILE.IDX files */
  204. {
  205.    byte priv;            /* Area's privilege level */
  206.    byte flags[MAXFLAGS]; /* Flags settings */
  207.    char key[13];         /* <reserved> */
  208.    word area;            /* Area absolute number */
  209. };
  210.  
  211. /* Privilege levels definitions */
  212.  
  213. #define  TWIT        0x10
  214. #define  DISGRACE    0x20
  215. #define  LIMITED     0x30
  216. #define  NORMAL      0x40
  217. #define  WORTHY      0x50
  218. #define  PRIVIL      0x60
  219. #define  FAVORED     0x70
  220. #define  EXTRA       0x80
  221. #define  CLERK       0x90
  222. #define  ASSTSYSOP   0xA0
  223. #define  SYSOP       0xB0
  224. #define  HIDDEN      0xC0
  225.  
  226. struct _sysinfo      /* Structure for the SYSINFO.DAT file */
  227. {
  228.    long quote_position;        /* Last position in the quote file */
  229.    unsigned long total_calls;  /* Total system calls */
  230.    char pwd[40];               /* Keyboard password (crypted) (*) */
  231.    unsigned long local_logons; /* Number of local logons */
  232.    unsigned long calls_300;    /* Number of 300 baud calls */
  233.    unsigned long calls_1200;   /* Number of 1200 baud calls */
  234.    unsigned long calls_2400;   /* Number of 2400 baud calls */
  235.    unsigned long calls_9600;   /* Number of 9600+ baud calls */
  236.    unsigned long calls_14400;  /* Number of 14400+ baud calls */
  237.    unsigned long failed_password; /* <reserved> (**) */
  238.    unsigned long normal_logoff;   /* <reserved> (**) */
  239.    unsigned long lost_download;   /* <reserved> (**) */
  240.    unsigned long lost_carrier;    /* <reserved> (**) */
  241.    unsigned long out_of_time;     /* <reserved> (**) */
  242.    unsigned long idle_logoff;     /* <reserved> (**) */
  243.    unsigned long sysop_logoff;    /* <reserved> (**) */
  244.    unsigned long new_users;       /* <reserved> (**) */
  245.    unsigned long file_ratio;      /* <reserved> (**) */
  246.    unsigned long kbytes_ratio;    /* <reserved> (**) */
  247.    unsigned long minutes_online;  /* <reserved> (**) */
  248.    unsigned long mailer_online;   /* <reserved> (**) */
  249. };
  250.  
  251. #define BROWSING     1
  252. #define UPLDNLD      2
  253. #define READWRITE    3
  254. #define DOOR         4
  255. #define CHATTING     5
  256. #define QUESTIONAIRE 6
  257.  
  258. struct _useron       /* Structure for the USERON.BBS file */
  259. {
  260.    char name[36];              /* User's name */
  261.    int  line;                  /* Task number currently on */
  262.    word baud;                  /* Baud rate */
  263.    char city[26];              /* User's city */
  264.    bit  donotdisturb: 1;       /* Do not disturb flag */
  265.    int  status;                /* User's status */
  266.    int  cb_channel;            /* CB Chat System channel */
  267. };
  268.  
  269. struct _lastcall     /* Structure for the LASTCALL.BBS file */
  270. {
  271.    int  line;                  /* Task number */
  272.    char name[36];              /* User's name */
  273.    char city[26];              /* User's city */
  274.    word baud;                  /* Baud rate */
  275.    long times;                 /* Times the user has called the system */
  276.    char logon[6];              /* Logon time HH:MM */
  277.    char logoff[6];             /* Logoff time HH:MM */
  278. };
  279.  
  280. struct _menu_header  /* Header of the *.MNU files
  281.  
  282.                         Menus are structured as follow:
  283.  
  284.                         <_menu_header>
  285.                            <_cmd> \
  286.                            ......  |- _menu_header.n_elem
  287.                            <_cmd> /
  288.                         <_menu_header>
  289.                            <_cmd> \
  290.                            ......  |- _menu_header.n_elem
  291.                            <_cmd> /
  292.                         ..............
  293.                       */
  294. {
  295.    char name[14];    /* Menu' name */
  296.    int  n_elem;      /* Number of struct _cmd records for this menu */
  297. };
  298.  
  299. struct _cmd          /* Structure for the *.MNU files */
  300. {
  301.    char  name[80];        /* User's display */
  302.    byte  priv;            /* Minimum level for this command */
  303.    byte  flags[MAXFLAGS]; /* Minimum flags setting */
  304.    int   flag_type;       /* Type of command */
  305.    bit   automatic: 1;    /* Automatic execution */
  306.    bit   nocls:     1;    /* Don't clear the screen if change menu' */
  307.    bit   first_time:1;    /* Executed only the first time the menu' is read */
  308.    byte  color;           /* Normal background and foreground colors */
  309.    byte  first_color;     /* Hilight background and foreground colors */
  310.    byte  hotkey;          /* Key that activate the command */
  311.    char  argument[50];    /* Optional argument list */
  312. };
  313.  
  314. struct _mail         /* Structure for the MSGTOIDX.DAT file */
  315. {
  316.    char to[36];                /* Recipient's name */
  317.    word area;                  /* Message area number */
  318.    word msg_num;               /* Message number */
  319. };
  320.  
  321. struct _lorainfo     /* Structure for the LORAINFO.Txx file.
  322.                         xx=Task number in two digit hex number */
  323. {
  324.    struct _usr usr;            /* The complete user record */
  325.    word baud;                  /* The current baud rate */
  326.    int  port;                  /* The current comm port number */
  327.    int  time;                  /* Minutes remaining for this call */
  328.    char log[40];               /* Log file name */
  329.    char system[80];            /* System name */
  330.    char sysop[36];             /* Sysop's name */
  331.    word task;                  /* Current task number */
  332.    word max_baud;              /* Maximum modem baud rate */
  333.    long posuser;               /* User's position in the user file */
  334.    word yelling;               /* Number of times the user has requested
  335.                                   for a chat */
  336.    word downloadlimit;         /* User's download limit */
  337.    int  max_time;              /* User's maximum on line time in 24h */
  338.    int  max_call;              /* User's maximum on line time for call */
  339.    word ratio;                 /* Download/upload ratio limit (0=No limit) */
  340.    word min_baud;              /* Minimum baud rate for user's level */
  341.    word min_file_baud;         /* Minimum baud rate for file transfers */
  342.    bit  wants_chat  :1;        /* 1=The user has request a chat */
  343.    bit  mnp_connect :1;        /* 1=MNP connection */
  344.    bit  keylock     :1;        /* 1=The keyboard is locked */
  345.    char logindate[20];         /* User's login date */
  346.    char password[40];          /* Keyboard password (crypted) (*) */
  347.    unsigned long total_calls;  /* Total system calls */
  348. };
  349.  
  350. /*
  351.     (*)  All the passwords are crypted with a proprietary algorithm for
  352.          system safety. Only known third party authors can request to the
  353.          autor the functions to perform the decryption/encryption.
  354.  
  355.     (**) Reserved fields are fields that aren't used as for now or are bytes
  356.          reserved for future enhancements.
  357. */
  358.  
  359.